#ifndef _WIN32

#include <stddef.h>
#include <string.h>

#define MIN(i, j) (((i) < (j)) ? (i) : (j))

extern "C" {
int memcpy_s(void *dest, size_t destMax, const void *src, size_t count)
{
    size_t copyCount = MIN(destMax, count);
    memcpy(dest, src, copyCount);
    return 0;
}
}

#endif

